#include<stdio.h>
int main()
{
	int n, i, j, row;
	printf("Please input the size of the diamond (Make sure it is a odd number):");
	scanf("%d", &n);
	if(n % 2 == 0)
	{
		printf("Please input a odd number!");
		return 1;
	}
	printf("Here's the diamond!\n");
	
	int key = n / 2;
	
	//Print the top half part
	for(row = 1; row <= n / 2; row ++)
	{
		//Print the space key 
		for(i = key; i > 0; i --)
		{
			printf(" ");
		}
		
		//Print the star
		for(j = 0; j < n - 2 * key ; j ++)
		{
			printf("*");
		}
		
		key -= 1;
		printf("\n");
	}
	
	//Print the middle part
	for(i = 0; i < n; i ++)
	{
		printf("*");
	}
	printf("\n");
	
	key = n / 2;
	//Print the bottom half part
	for(row = 1; row <= n / 2; row ++)
	{
		//Print the space key 
		for(i = 0; i < n / 2 + 1 - key; i ++)
		{
			printf(" ");
		}
		
		//Print the star
		for(j = 0; j < 2 * key - 1; j ++)
		{
			printf("*");
		}
		
		key -= 1;
		printf("\n");
	}
}
